import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login/login.vue'
import Reg from '@/views/Reg/reg.vue'
import Layout from '@/views/Layout/index.vue'

import Home from '@/views/Layout/home/index.vue'
import ArtCate from '@/views/Layout/art/art-cate.vue'
import ArtList from '@/views/Layout/art/art-list.vue'
import UserInfo from '@/views/Layout/user/user-info.vue'
import UserAvatar from '@/views/Layout/user/user-avatar.vue'
import UserPwd from '@/views/Layout/user/user-pwd.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Login
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/reg',
    component: Reg
  },
  {
    path: '/layout',
    component: Layout,
    children: [
      {
        path: '/home',
        component: Home
      },
      {
        path: '/art-cate',
        component: ArtCate
      },
      {
        path: '/art-list',
        component: ArtList
      },
      {
        path: '/user-info',
        component: UserInfo
      },
      {
        path: '/user-avatar',
        component: UserAvatar
      },
      {
        path: '/user-pwd',
        component: UserPwd
      }
    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
